/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Ejercicio2;

import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.text.TabableView;

/**
 *
 * @author Usuario
 */
public class InnerJoin extends javax.swing.JFrame {

    /**
     * Creates new form InnerJoin
     */
    //atributos
    private String Prestatario [];
    private DefaultTableModel TPrestatario;
    private String Cliente [];
    private DefaultTableModel TCliente;
    private String JoinN [];
    private DefaultTableModel TJoinN;
    
    private int nroPrestatarios;
    private int nroClientes;
    
    public InnerJoin() {
        initComponents();
        //clientes
        //nroPrestatarios= TablaPrestatario.getRowCount();
        //nroClientes= TablaCliente.getRowCount();
        //
        JoinN = new String[7]; 
        TJoinN=(DefaultTableModel)TablaInnerJoin.getModel();
        //agregando elementos a las tabla prestatario
        TPrestatario = (DefaultTableModel)TablaPrestatario.getModel();
        Prestatario = new String[3];
        //agregando 1 primer elemento
        Prestatario[0]="PR1";
        Prestatario[1]="CL01";
        Prestatario[2]="103";
        TPrestatario.addRow(Prestatario);
        //agregando 2 elemento
        Prestatario[0]="PR2";
        Prestatario[1]="CL04";
        Prestatario[2]="106";
        TPrestatario.addRow(Prestatario);
        //agregando 3 elemento
        Prestatario[0]="PR3";
        Prestatario[1]="CL07";
        Prestatario[2]="108";
        TPrestatario.addRow(Prestatario);
        //TablaPrestatario.setModel(TPrestatario);
        //agregando elementos a las tabla cliente
        TCliente = (DefaultTableModel)TablaCliente.getModel();
        Cliente = new String[4];
        //Agregando 1 cliente
        Cliente[0]="CL01";
        Cliente[1]="Ivan Quispe Soto";
        Cliente[2]="Av. Sol 102";
        Cliente[3]="976232134";
        TCliente.addRow(Cliente);
        //Agregando 2 cliente 
        Cliente[0]="CL02";
        Cliente[1]="Jorge ttito Soto";
        Cliente[2]="Av. Angel 122";
        Cliente[3]="976532134";
        TCliente.addRow(Cliente);
        //Agregando 3 cliente 
        Cliente[0]="CL03";
        Cliente[1]="Maria Busta Quispe";
        Cliente[2]="Av. LLorones 322";
        Cliente[3]="976532122";
        TCliente.addRow(Cliente);
        //Agregando 4 cliente 
        Cliente[0]="CL04";
        Cliente[1]="Marte Busta Ttito";
        Cliente[2]="Av. Inka 1022";
        Cliente[3]="986532122";
        TCliente.addRow(Cliente);
        //Agregando 5 cliente 
        Cliente[0]="CL05";
        Cliente[1]="Walter Vanda Quispe";
        Cliente[2]="Av. Mananteales 1012";
        Cliente[3]="984531122";
        TCliente.addRow(Cliente);
        //Agregando 6 cliente 
        Cliente[0]="CL06";
        Cliente[1]="Javier Mamani Mamani";
        Cliente[2]="Av. Tupac 2312";
        Cliente[3]="974533332";
        TCliente.addRow(Cliente);
         //Agregando 7 cliente 
        Cliente[0]="CL07";
        Cliente[1]="Hugo Mendoza Ugarte";
        Cliente[2]="Av. Tupac 1312";
        Cliente[3]="974331132";
        TCliente.addRow(Cliente);
        //Agregando 8 cliente 
        Cliente[0]="CL08";
        Cliente[1]="Marelin Tupa Meza";
        Cliente[2]="Av. Kary Grande q-12";
        Cliente[3]="974111166";
        TCliente.addRow(Cliente);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        TablaPrestatario = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        TablaCliente = new javax.swing.JTable();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        buInnerJoin = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        TablaInnerJoin = new javax.swing.JTable();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        txtIdPrestatario = new javax.swing.JTextField();
        txtIdCliente = new javax.swing.JTextField();
        txtNumPrestamo = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtIdCliente2 = new javax.swing.JTextField();
        txtNombre = new javax.swing.JTextField();
        txtDireccion = new javax.swing.JTextField();
        txtTelefono = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 51, 204));
        jLabel1.setText("Provando Inner Join");

        TablaPrestatario.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID_Prestatario", "ID_Cliente", "NumeroPrestamo"
            }
        ));
        jScrollPane2.setViewportView(TablaPrestatario);

        TablaCliente.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID_Cliente", "NombreCliente", "Direccion", "Telefono"
            }
        ));
        jScrollPane3.setViewportView(TablaCliente);

        jLabel2.setForeground(new java.awt.Color(0, 0, 153));
        jLabel2.setText("Prestatario :");

        jLabel3.setForeground(new java.awt.Color(0, 0, 153));
        jLabel3.setText("Cliente :");

        buInnerJoin.setText("Inner Join");
        buInnerJoin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buInnerJoinActionPerformed(evt);
            }
        });

        TablaInnerJoin.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "ID_Prestatario", "ID_Cliente", "NumeroPrestamo", "NombreCliente", "Direccion", "Telefono"
            }
        ));
        jScrollPane4.setViewportView(TablaInnerJoin);

        jLabel4.setForeground(new java.awt.Color(0, 0, 153));
        jLabel4.setText("ID Prestatario :");

        jLabel5.setForeground(new java.awt.Color(0, 0, 153));
        jLabel5.setText("ID Cliente :");

        jLabel6.setForeground(new java.awt.Color(0, 0, 153));
        jLabel6.setText("Numero Prestamo :");

        jButton1.setText("Agregar Prestatario");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel7.setForeground(new java.awt.Color(0, 0, 153));
        jLabel7.setText("ID Cliente :");

        jLabel8.setForeground(new java.awt.Color(0, 0, 153));
        jLabel8.setText("Nombre :");

        jLabel9.setForeground(new java.awt.Color(0, 0, 153));
        jLabel9.setText("Direccion :");

        jLabel10.setForeground(new java.awt.Color(0, 0, 153));
        jLabel10.setText("Telefono :");

        jButton2.setText("Agregar Cliente");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Limpiar Tabla");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jButton4.setText("Salir");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(157, 157, 157)
                        .addComponent(jLabel2))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(258, 258, 258)
                        .addComponent(jLabel1)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton4)
                .addGap(139, 139, 139))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(buInnerJoin)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(47, 47, 47)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel6)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(63, 63, 63)
                                        .addComponent(jLabel4)))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtIdPrestatario, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtIdCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtNumPrestamo, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(97, 97, 97)
                                .addComponent(jButton1)))
                        .addGap(267, 267, 267)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10)
                            .addComponent(jLabel7))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtIdCliente2, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))))
                .addContainerGap(22, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addGap(312, 312, 312))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 814, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(51, 51, 51))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(20, 20, 20)
                                .addComponent(jLabel1))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(69, 69, 69)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel2)
                                    .addComponent(jLabel3))))
                        .addGap(19, 19, 19)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(txtIdPrestatario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)
                            .addComponent(txtIdCliente2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jButton4)
                        .addGap(58, 58, 58)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtIdCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel8)
                    .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNumPrestamo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(jLabel9)
                    .addComponent(txtDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel10)
                        .addComponent(txtTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addGap(13, 13, 13)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buInnerJoin)
                    .addComponent(jButton3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    //simulando el inner join
    private void buInnerJoinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buInnerJoinActionPerformed
        // TODO add your handling code here:
        nroPrestatarios= TablaPrestatario.getRowCount();
        nroClientes= TablaCliente.getRowCount();
        for(int i=0;i<nroPrestatarios;i++)
        {
            //filas i, columnas 0,1,2
            Prestatario[0]=TablaPrestatario.getValueAt(i,0).toString();
            Prestatario[1]=TablaPrestatario.getValueAt(i,1).toString();
            Prestatario[2]=TablaPrestatario.getValueAt(i,2).toString();
            //buscamos el valor que sea = al campo IDCliente del prestatario y del Cliente
            for(int j=0;j<nroClientes;j++)
            {
                //filas i, columnas 0,1,2
                Cliente[0]=TablaCliente.getValueAt(j,0).toString();
                Cliente[1]=TablaCliente.getValueAt(j,1).toString();
                Cliente[2]=TablaCliente.getValueAt(j,2).toString();
                Cliente[3]=TablaCliente.getValueAt(j,3).toString();
                //equals combiene ya que si camparas el arreglo de "" con el de un txt getText == no reconocera como iguales
                if(Prestatario[1].equals(Cliente[0]))
                {
                    JoinN[0]=Prestatario[0];
                    JoinN[1]=Prestatario[1];
                    JoinN[2]=Prestatario[2];
                    JoinN[3]=Cliente[0];
                    JoinN[4]=Cliente[1];
                    JoinN[5]=Cliente[2];
                    JoinN[6]=Cliente[3];
                    TJoinN.addRow(JoinN);
                    JOptionPane.showMessageDialog(null,"Concuerda Agregamos: TPrestatario inner join TClient : on TPrestatario.ID_Cliente("+Prestatario[1]+ ") = TCliente.ID_Cliente("+Cliente[0]+");");
                    //JOptionPane.showMessageDialog(null,"Concuerda ID_PCliente : "+Prestatario[1]+ "// ID_Cliente : "+Cliente[0]);
                    break;
                }
                else
                {
                    JOptionPane.showMessageDialog(null,"No Concuerda no Agregamos: TPrestatario inner join TClient : on TPrestatario.ID_Cliente("+Prestatario[1]+ ") = TCliente.ID_Cliente("+Cliente[0]+");");
                }
            }
        }
    }//GEN-LAST:event_buInnerJoinActionPerformed
    //Agregamos prestatarios
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        Prestatario[0]=txtIdPrestatario.getText().toString();
        Prestatario[1]=txtIdCliente.getText().toString();
        Prestatario[2]=txtNumPrestamo.getText().toString();
        TPrestatario.addRow(Prestatario);
        txtIdPrestatario.setText("");
        txtIdCliente.setText("");
        txtNumPrestamo.setText("");
        //colocamos cursor sobre el campo de texto
        txtIdPrestatario.requestFocus();
        //actualizamos el numero de prestatarios
        //nroPrestatarios=TablaPrestatario.getRowCount();
        //nroClientes=TablaCliente.getRowCount();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        Cliente[0]=txtIdCliente2.getText().toString();
        Cliente[1]=txtNombre.getText().toString();
        Cliente[2]=txtDireccion.getText().toString();
        Cliente[3]=txtTelefono.getText().toString();
        TCliente.addRow(Cliente);
        txtIdCliente2.setText("");
        txtNombre.setText("");
        txtDireccion.setText("");
        txtTelefono.setText("");
        //colocamos cursor sobre el campo de texto
        txtIdCliente2.requestFocus();
        //actualizamos el numero de prestatarios
        nroClientes=TablaCliente.getRowCount();
    }//GEN-LAST:event_jButton2ActionPerformed
    //limpiamos la tabla
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        TJoinN= new DefaultTableModel();
        TJoinN.addColumn("ID_Prestatario");
        TJoinN.addColumn("ID_Cliente");
        TJoinN.addColumn("NumeroPrestamo");
        TJoinN.addColumn("ID_Cliente");
        TJoinN.addColumn("NombreCliente");
        TJoinN.addColumn("Direccion");
        TJoinN.addColumn("Telefono");
        TablaInnerJoin.setModel(TJoinN);
        TJoinN=(DefaultTableModel)TablaInnerJoin.getModel();
        
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        System.exit(1);
    }//GEN-LAST:event_jButton4ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(InnerJoin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(InnerJoin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(InnerJoin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(InnerJoin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new InnerJoin().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTable TablaCliente;
    private javax.swing.JTable TablaInnerJoin;
    private javax.swing.JTable TablaPrestatario;
    private javax.swing.JButton buInnerJoin;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField txtDireccion;
    private javax.swing.JTextField txtIdCliente;
    private javax.swing.JTextField txtIdCliente2;
    private javax.swing.JTextField txtIdPrestatario;
    private javax.swing.JTextField txtNombre;
    private javax.swing.JTextField txtNumPrestamo;
    private javax.swing.JTextField txtTelefono;
    // End of variables declaration//GEN-END:variables
}
